package com.kanas.webak.config.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import com.kanas.framework.support.AbstractModel;
import com.kanas.framework.util.StringUtils;

@Entity
@Table(name="kanas_i18n_resource")
@JsonIgnoreProperties({""})
public class I18nResource extends AbstractModel {

	@Transient
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="id", length=32)
	private String id;
	@Column(name="code", length=100)
	private String code;
	@Column(name="lang", length=5)
	private String lang;
	@Column(name="label", length=255)
	private String label;
	@Column(name="scope", length=100)
	private String scope;
	
	@Transient
	private String oldId;
	
	public I18nResource() {
		this.id = StringUtils.generateUUID();
	}
	
	public I18nResource(String code, String label, String lang, String scope) {
		this.id = StringUtils.generateUUID();
		this.code = code;
		this.label = label;
		this.lang = lang;
		this.scope = scope;
	}
	
	@Override
	public String toIdString() {
		return id;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getLang() {
		return lang;
	}

	public void setLang(String lang) {
		this.lang = lang;
	}

	public String getScope() {
		return scope;
	}

	public void setScope(String scope) {
		this.scope = scope;
	}

	public String getOldId() {
		return oldId;
	}

	public void setOldId(String oldId) {
		this.oldId = oldId;
	}
	
}
